﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using KMS.Core.domain.model.post;
using KMS.Web.Views.Projects;

namespace KMS.Web.Views.Shared
{
    public class ResourceViewModel
    {
        //private Resource _resource;

        public UserViewModel Author { get; set; }

        public ProjectViewModel Project { get; set; }

        public string Title
        {
            get;
            set;
        }

        public string Content
        {
            get;
            set;
        }

        public string DateTimeCreated
        {
            get;
            set;
        }

        public ResourceViewModel(Resource resource)
        {
            Title = resource.Title;
            Content = resource.Content;
            DateTimeCreated = resource.DateTimeCreated.ToString("dd MMM HH:mm");
            Author = new UserViewModel(resource.Author);
            Project = new ProjectViewModel(resource.InitialProject);
        }

        public ResourceViewModel()
        {

        }
    }
}
